package com.ayoka.parenting.bean;

import android.text.TextUtils;

import com.ayoka.parenting.R;
import com.ayoka.parenting.widget.SelectorItemDialog;
import com.jincp.common.utils.UIUtils;

import java.io.Serializable;

/**
 * @ProjectName: AyokaClient.
 * @ClassName: BasicUserInfoBean.
 * @Description: .
 * @Author: jincp.
 * @CreateDate: 2019/11/4 17:47.
 */

public class BasicUserInfoBean implements Serializable, SelectorItemDialog.SelectorItemBean {

    public String ID;
    public String OpenID;
    public String WeixinNickName;
    public String WeixinCountry;
    public String WeixinProvince;
    public String WeixinCity;
    public int Sex;
    public int SubscribeStatus;
    public String Avatar;
    public String LocalAvatar;
    public String LocalWxAvatar;
    public int Status;
    public String CreateDate;
    public String LastUpdate;

    public boolean isOnline = true;
    public boolean isSpeaking;

    public boolean isSelected;

    public String taskCompletedStatus;

    public BasicUserInfoBean(String id, String weixinNickName, String localAvatar) {
        ID = id;
        WeixinNickName = weixinNickName;
        LocalAvatar = localAvatar;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        BasicUserInfoBean that = (BasicUserInfoBean) obj;
        return TextUtils.equals(ID, that.ID);
    }

    @Override
    public String toString() {
        return "id = " + ID + "   Name = " + WeixinNickName + "   isOnline = " + isOnline + "   isSpeaking = " + isSpeaking;
    }

    @Override
    public String getItemText() {
        return WeixinNickName;
    }

    @Override
    public int getItemTextColor() {
        return UIUtils.getColor(R.color.black_10);
    }

    @Override
    public boolean isSelected() {
        return isSelected;
    }

    @Override
    public void setSelected(boolean isSelected) {
        this.isSelected = isSelected;
    }

    @Override
    public Object getItemValue() {
        return true;
    }
}
